Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Configure script</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Configure_script"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Configure_script rootpage-Configure_script skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main">configure script</span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>When installing a package on a <a href="Unix" title="Unix">Unix</a> or <a href="Unix-like" title="Unix-like">Unix-like</a> environment, a <b>configure script</b> is a <a href="Shell_script" title="Shell script">shell script</a> that generates <a href="Software_build" title="Software build">build</a> configuration files for a <a href="Codebase" title="Codebase">codebase</a> to facilitate cross-platform support. It generates files tailoring for the host system – the environment on which the codebase is built and run.
</p><p>Even though there are no standards for such a script, the pattern is so ubiquitous that many developers are familiar with and even expect a script named <i>configure</i> that has this functionality. The script can be and originally was hand-coded. Today, multiple tools are available for generating a configure script based on special configuration files. One commonly used tool is <a href="Autotools" class="mw-redirect" title="Autotools">Autotools</a> which generates a <a href="Bash_(Unix_shell)" title="Bash (Unix shell)">Bash</a> script.
</p><p>Obtaining a software package as <a href="Source_code" title="Source code">source code</a> and <a href="Compiler" title="Compiler">compiling</a> it locally is a common scenario on <a href="Unix" title="Unix">Unix</a> and <a href="Unix-like" title="Unix-like">Unix-like</a> environments. Typically, this process involves the following steps:
</p>
<ol><li>Generate build configuration files</li>
<li>Build the code</li>
<li>Install the result to an accessible location</li></ol>
<p>A configure script accomplishes the first step by generating a <a href="Makefile" class="mw-redirect" title="Makefile">makefile</a> that is configured for the host system. This includes using the <a href="Library_(computer_science)" class="mw-redirect" title="Library (computer science)">libraries</a> of the host as required by the codebase.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Use">Use</h2></div>
<p>After navigating a command-line <a href="Shell_(computing)" title="Shell (computing)">shell</a> to the directory that contains the source code, the following commands are typically executed:<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-sh mw-content-ltr" dir="ltr"><pre>./configure
make
make<span class="w"> </span>install
</pre></div>
<p>For the Autotools, the configure script logs status and errors to file <i>config.log</i>, and the command <code>./configure --help</code> outputs command line help information.
</p><p>Often, a document with instructions is included with the codebase; often in a file named <code>INSTALL</code>. It can be helpful if the configure script fails.
</p>
<div class="mw-heading mw-heading2"><h2 id="Generating">Generating</h2></div>
<p>Autotools simplifies some of the challenges of <a href="Cross-platform_software" title="Cross-platform software">cross-platform software</a> development.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> These tools query the host system for environment settings, platform architecture, and the existence and location of required build and runtime dependencies. They store the gathered information in <code>configure.ac</code> to be read by <code>configure</code> during the installation phase.
</p><p>In new development, library dependency checking can be accomplished via <a href="Pkg-config" title="Pkg-config">pkg-config</a> via the <a href="M4_(computer_language)" title="M4 (computer language)">m4</a> macro, PKG_CHECK_MODULES. Before pkg-config gained popularity, separate m4 macros were created to locate files known to be included in the distribution of libraries depended upon.
</p>
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<p>The first program to come with a configure script was <a href="Rn_(newsreader)" title="Rn (newsreader)">rn</a> by <a href="Larry_Wall" title="Larry Wall">Larry Wall</a> in 1984. The script was written by hand and produced a jocular running commentary when executed. It still survives as part of the build system of the <b>trn</b> program.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p><p>Since then, an ecosystem of tools have been developed to automate the creation of configure scripts, of which the most common is <a href="Autoconf" title="Autoconf">Autoconf</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.control-escape.com/linux/lx-swinstall-tar.html">"Compiling Linux Software from Source Code"</a>. Control-Escape's Linux Help Engine<span class="reference-accessdate">. Retrieved <span class="nowrap">20 November</span> 2010</span>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.gnu.org/software/autoconf/">"Autoconf - GNU Project - Free Software Foundation (FSF)"</a>. GNU Operating System<span class="reference-accessdate">. Retrieved <span class="nowrap">20 November</span> 2010</span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://github.com/acli/trn/blob/613a7e97aca06dd807fb225990fa804e8c744574/Configure">"Configure script of trn"</a>. GitHub<span class="reference-accessdate">. Retrieved <span class="nowrap">10 December</span> 2020</span>.</cite></span>
</li>
</ol></div></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-03-17" href="https://en.wikipedia.org/wiki/?title=Configure_script&amp;oldid=1280973179">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>